#include <Game\Include\GameEvent.h>


GameEvent::GameEvent(GameEventType t)
{
    this->event_type = t;
}

GameEvent::GameEvent(std::istream &s)
{
    ISerializable::read(s, this->event_type);    
}

GameEvent::~GameEvent(void)
{
}

unsigned int GameEvent::serialize(std::ostream &s)
{
    unsigned int bytes_written = 0;
    bytes_written += ISerializable::write(s, this->event_type);
    return bytes_written;
}

GameEvent::GameEventType GameEvent::getEventType(std::istream &s)
{
    GameEventType t;
    std::streampos pos_reading = s.tellg();
    ISerializable::read(s, t);
    s.seekg(pos_reading);
    return t;
}

GameEvent::GameEventType GameEvent::getEventType() const
{
    return this->event_type;
}
